package io.hugetower.modules.mq;


import io.hugetower.common.utils.R;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/app")
public class TestController1 {

    /**
     * 测试接口
     */
    @RequestMapping("/test")
    public R test() {
        return R.ok("测试接口");
    }


    @Autowired
    MsgProducer msgProducer;

    /**
     * 发送消息
     */
    @RequestMapping("/sendMsg")
    public R sendMsg(String msg) {
        msgProducer.sendMsg(msg);
        return R.ok("发送成功-sendMsg:"+msg);
    }


}
